
import numpy as np
import sys 
sys.path.append('..')
from common.util import create_co_matrix, ppmi, preprocess


text = "You say goodbye and I say hello."
corpus, word_to_id, id_to_word = preprocess(text)
vocab_size = len(word_to_id)
C = create_co_matrix(corpus,vocab_size)
W = ppmi(C)

np.set_printoptions(precision=3)
print('covariance matrix')
print(C)
print('-'*30)
print('PPMI')
print(W)